from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
url = r"E:\MyProfile\PythonAutomation\任务书\xpath.html"
driver.get(url)
inputs = driver.find_elements(By.XPATH, "//input")
labels = driver.find_elements(By.XPATH, "//label[@for]")

for _input, label in zip(inputs, labels):
    _input.send_keys(label.text)
input("按任意键关闭")
driver.quit()
